package com.xand.bt.terminal.common.util;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;

public class FileHelper {

	public static Properties readPropertiesFile(String filename) {
		Properties ret = new Properties();

		try {
			InputStream is = new FileInputStream(filename);
	
			ret.load(is);
		} catch(IOException e){
			ret = null;
		}

		return ret;
	}

	public static void writeTextToFile(String text, String file) throws IOException {

		OutputStream outputStream = new FileOutputStream(file);
		outputStream.write(text.getBytes());
		outputStream.flush();
		outputStream.close();

	}

}
